package com.battle.service.controller.web;

import com.battle.pojo.param.examStudyDetails.*;
import com.battle.pojo.vo.examStudyDetails.*;
import com.battle.service.service.in.*;
import nirvana.core.domains.vo.PageResult;
import nirvana.core.domains.vo.ApiResult;
import org.springframework.web.bind.annotation.*;

import jakarta.validation.Valid;

import java.util.List;

/**
*   web/用户考试详情管理
* 【描 述】：
* 【环 境】：J2SE
* 【详 细】：
*
*/
@RestController
@RequestMapping("/examStudyDetails/web")
public class ExamStudyDetailsWebController {

private final ExamStudyDetailsService service;

public ExamStudyDetailsWebController(ExamStudyDetailsService service) {
this.service = service;
}


/**
* 创建用户考试详情管理
* @param param
* @return
*/
@PostMapping("/createExamStudyDetails")
public ApiResult createExamStudyDetails(@RequestBody @Valid CreateExamStudyDetailsParam param){
service.createExamStudyDetails(param);
return ApiResult.ok();
}


/**
* 修改用户考试详情管理
* @param param
*/
@PutMapping("/editExamStudyDetails")
public ApiResult editExamStudyDetails(@RequestBody @Valid EditExamStudyDetailsParam param){
service.editExamStudyDetails(param);
return ApiResult.ok();
}

/**
* 移除用户考试详情管理
* @param id
*/
@DeleteMapping("/removeExamStudyDetails")
public ApiResult removeExamStudyDetails(@RequestParam("id") Long id){
service.removeExamStudyDetails(id);
return ApiResult.ok();
}

/**
* 启动/禁用用户考试详情管理
* @param id
*/
@GetMapping("/enabledExamStudyDetails")
public ApiResult enabledExamStudyDetails(@RequestParam("id") Long id){
service.enabledExamStudyDetails(id);
return ApiResult.ok();
}

/**
* 获取用户考试详情管理详情
* @param id
* @return
*/
@GetMapping("/getExamStudyDetails")
public ApiResult< GetExamStudyDetailsVo> getExamStudyDetails(@RequestParam("id") Long id){
GetExamStudyDetailsVo vo = service.getExamStudyDetails(id);
return ApiResult.ok(vo);
}

/**
* 获取用户考试详情管理列表
* @param param
* @return
*/
@PostMapping("/getExamStudyDetailsList")
public ApiResult< PageResult< GetExamStudyDetailsListVo>> getExamStudyDetailsList(@RequestBody GetExamStudyDetailsListParam param){
PageResult< GetExamStudyDetailsListVo> result = service.getExamStudyDetailsList(param);
return ApiResult.ok(result);
}


/**
* 获取用户考试详情管理下拉列表
*
* @return
*/
@PostMapping("/getExamStudyDetailsDownList")
public ApiResult< List< GetExamStudyDetailsDownListVo > > getExamStudyDetailsDownList(@RequestBody(required = false) @Valid GetExamStudyDetailsDownListParam param) {
List< GetExamStudyDetailsDownListVo > list = service.getExamStudyDetailsDownList(param);
return ApiResult.ok(list);
}


}

